package com.lemon.smartsafety.app;

import com.lemon.smartsafetynew.entity.common.CommonBo;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Cooliean on 16/1/24.
 */
public class ApplicationInfo {
    public static String MOBILE_REQUEST_PASSWORD = "jszy@2010";
    public static String TYPE_COMPANY            = "company";
    public static String TYPE_GOV                = "gov";


    /**
     * 用户类型
     */
    public static final String ADMIN_CODE     = "admin";
    /**
     * 企业负责人
     */
    public static final String MAJOR_CODE     = "major";
    /**
     * 企业安全负责人
     */
    public static final String SAFER_CODE     = "safer";
    /**
     * 安全员
     */
    public static final String WORKER_CODE    = "worker";
    /**
     * 机构负责人
     */
    public static final String CHARGER_CODE   = "charger";
    /**
     * 机构工作人员
     */
    public static final String MANAGER_CODE   = "manager";
    /**
     * 数据采集员
     */
    public static final String DATA_COLLECTOR = "data_collector";
    /**
     * 维保单位负责人
     */
    public static final String KEEP_MAJOR     = "keep_major";
    /**
     * 维保单位工作人员
     */
    public static final String KEEP_WORKER    = "keep_worker";

    /**
     * 上报系统管理员
     */
    public static final String REPORT_ADMIN = "report_admin";

    //add by Andrew.yin 2017/10/9 begin
    /**
     * 产品支持人员
     */
    public static final String PRODUCT_SUPPORT = "product_support";
    //add by Andrew.yin 2017/10/9 end


    // ========= 常熟项目的角色权限 2017/10/21 begin ==========

    /**
     * 系统管理员
     */
    public static final String ADMIN = "admin";

    /**
     * 监管机构用户
     */
    public static final String ADMINISTRATION = "administration";

    /**
     * 安监机构用户
     */
    public static final String MONITOR = "monitor";

    /**
     * 企业用户
     */
    public static final String COMPANY = "company";

    /**
     * 安评机构用户
     */
    public static final String EVALUATE = "evaluate";

    /**
     * 培训机构人员
     */
    public static final String TRAIN = "train";

    /**
     * 职业卫生技术服务人员
     */
    public static final String PROFESSION_SERVICE = "profession_service";

    /**
     * 职业卫生健康检查机构人员
     */
    public static final String PROFESSION_TEST = "profession_test";

    /**
     * 职业卫生诊断机构人员
     */
    public static final String PROFESSION_DIAGNOSE = "profession_diagnose";

    /**
     * 职工用户
     */
    public static final String EMPLOYEE = "employee";

    /**
     * 其他用户
     */
    public static final String OTHER_USER = "other_user";

    /**
     * 企业法人
     */
    public static final String COMPANY_LEGAL_PERSON = "company_legal_person";

    /**
     * 企业负责人
     */
    public static final String COMPANY_CHARGER = "company_charger";

    /**
     * 企业安全管理员
     */
    public static final String COMPANY_SAFE_MANAGER = "company_safe_manager";

    /**
     * 企业安全员
     */
    public static final String COMPANY_SAFER = "company_safer";

    /**
     * 政府管理员
     */
    public static final String GOV_MANAGER = "gov_manager";

    /**
     * 政府人员
     */
    public static final String GOV_PERSON = "gov_person";

    /**
     * 市领导
     */
    public static final String GOV_CITY_LEADER = "gov_city_leader";

    /**
     * 市安监局
     */
    public static final String GOV_CITY_ANJIAN = "gov_city_anjian";

    /**
     * 市质监局
     */
    public static final String GOV_CITY_ZHIJIAN = "gov_city_zhijian";

    /**
     * 市消防局
     */
    public static final String GOV_CITY_XIAOFANG = "gov_city_xiaofang";

    /**
     * 镇领导
     */
    public static final String GOV_TOWN_LEADER = "gov_town_leader";

    /**
     * 镇安监办
     */
    public static final String GOV_ZHEN_ANJIAN = "gov_zhen_anjian";

    /**
     * 镇消防办
     */
    public static final String GOV_ZHEN_XIAOFANG = "gov_zhen_xiaofang";

    /**
     * 网格员
     */
    public static final String GOV_GRID_WORKER = "gov_grid_worker";

    /**
     * 安纪委
     */
    public static final String GOV_CITY_ANJIWEI = "gov_city_anjiwei";

    /**
     * 安技员
     */
    public static final String GOV_GRIDER = "gov_grider";



    // ========= 常熟项目的角色权限 2017/10/21 end ============

    public static Map<String, String> userTypeMap = new HashMap<String, String>();

    static {
        //delete by Andrew.yin 2017/10/21 begin
//        userTypeMap.put(ADMIN_CODE, "系统管理员");
//        userTypeMap.put(MAJOR_CODE, "企(事)业负责人");
//        userTypeMap.put(SAFER_CODE, "企(事)业安全管理人");
//        userTypeMap.put(WORKER_CODE, "企(事)业安全员");
//        userTypeMap.put(CHARGER_CODE, "政府机构负责人");
//        userTypeMap.put(MANAGER_CODE, "政府机构工作人员");
//        userTypeMap.put(DATA_COLLECTOR, "系统数据员");
//        userTypeMap.put(REPORT_ADMIN, "上报系统管理员");
//        userTypeMap.put(KEEP_MAJOR, "维保单位负责人");
//        userTypeMap.put(KEEP_WORKER, "维保单位工作人员");
//        userTypeMap.put(PRODUCT_SUPPORT, "产品支持人员");
        //delete by Andrew.yin 2017/10/21 end

        // ====常熟项目角色权限====
        userTypeMap.put(ADMIN, "系统管理员");
        userTypeMap.put(ADMINISTRATION, "监管机构用户");
        userTypeMap.put(MONITOR, "安监机构用户");
        userTypeMap.put(COMPANY, "企业用户");
        userTypeMap.put(EVALUATE, "安评机构用户");
        userTypeMap.put(TRAIN, "培训机构人员");
        userTypeMap.put(PROFESSION_SERVICE, "职业卫生技术服务人员");
        userTypeMap.put(PROFESSION_TEST, "职业卫生健康检查机构人员");
        userTypeMap.put(PROFESSION_DIAGNOSE, "职业卫生诊断机构人员");
        userTypeMap.put(EMPLOYEE, "职工用户");
        userTypeMap.put(OTHER_USER, "其他用户");
        if (CommonBo.Project.CAMPUS.getValue().equals(Constants.VERSION_SUFFIX)) {
            userTypeMap.put(COMPANY_LEGAL_PERSON, "学校法人");
            userTypeMap.put(COMPANY_CHARGER, "学校负责人");
            userTypeMap.put(COMPANY_SAFE_MANAGER, "学校安全管理员");
            userTypeMap.put(COMPANY_SAFER, "学校安全员");
        } else {
            userTypeMap.put(COMPANY_LEGAL_PERSON, "企业法人");
            userTypeMap.put(COMPANY_CHARGER, "企业负责人");
            userTypeMap.put(COMPANY_SAFE_MANAGER, "企业安全管理员");
            userTypeMap.put(COMPANY_SAFER, "企业安全员");
        }
        userTypeMap.put(GOV_MANAGER, "政府管理员");
        userTypeMap.put(GOV_PERSON, "政府人员");
        userTypeMap.put(GOV_CITY_LEADER, "市领导");
        userTypeMap.put(GOV_CITY_ANJIAN, "市安监局");
        userTypeMap.put(GOV_CITY_ZHIJIAN, "市质监局");
        userTypeMap.put(GOV_CITY_XIAOFANG, "市消防局");
        userTypeMap.put(GOV_TOWN_LEADER, "镇领导");
        userTypeMap.put(GOV_ZHEN_ANJIAN, "镇安监办");
        userTypeMap.put(GOV_ZHEN_XIAOFANG, "镇消防办");
        userTypeMap.put(GOV_GRID_WORKER, "网格员");
        userTypeMap.put(GOV_CITY_ANJIWEI, "安纪委");
        userTypeMap.put(GOV_GRIDER, "安技员");

    }

//    /**
//     * 获取用户类型
//     *
//     * @param key
//     * @return
//     */
//    public static String getUserTypeName(String key) {
//        return userTypeMap.get(key);
//    }

    /**
     * 功能代码
     1、隐患自查自报
     2、用户中心
     3、安全巡查
     4、安全公告
     5、通讯录
     6、积分商城
     7、九小场所
     8、瑞眼（消防物联）
     */
    public enum ApplicationCode {
        HIDDEN_DANGER("hidden_danger"),
        USER_PROFILE("user_profile"),
        FIRE_SAFE("fire_safe"),
        ANJIAN_NOTICE("anjian_notice"),
        FIRE_ADDRESS("addr_book"),
        JIFEN_SHOP("jifen_shop"),
        NINE_SMALL("nine_small"),
        FIRE_SUPERVISON("fire_supervision"),
        ECHART_TEST("echart_test");
        //  RAY("ray_eye");

        private ApplicationCode(String code) {
            this.mCode = code;
        }

        private String mCode;

        public String getCode() {
            return this.mCode;
        }
    }

    //add by Andrew.yin 2017/7/3 begin. [工作]页面选项码, 用于Event事件的区分
    public enum WorkOptionCodeEnum {

        //六宫格
        COMPANY_INFO("COMPANY_INFO"),
        SAFE_PATROL("SAFE_PATROL"),
        SAFE_HIDDEN_DANGER("SAFE_HIDDEN_DANGER"),
        SAFE_LEDGER("SAFE_LEDGER"),
        MONITOR("MONITOR"),
        DEVICE_MANAGE("DEVICE_MANAGE"),
        //EMERGENCY_PROCESS("EMERGENCY_PROCESS"),
        EVENT_PROCESS("EVENT_PROCESS"),
        SNAPSHOT("SNAPSHOT"),
        ELECTRICAL_SAFETY("ELECTRICAL_SAFETY"),
        VIDEO_MONITOR("VIDEO_MONITOR"),
        ONLINE_CLASAROOM("ONLINE_CLASAROOM"),
        PATROL_PATH("PATROL_PATH"),
        INSPECTION_TASK("INSPECTION_TASK"),
        //列表
        LAWS_REGULATIONS("LAWS_REGULATIONS"),
        CASE_SHARE("CASE_SHARE"),
        KNOWLEDGE_BASE("KNOWLEDGE_BASE"),
        ONLINE_CLASS("ONLINE_CLASS"),
        USER_HELP("USER_HELP");

        private String mCode;

        public String getCode() {
            return this.mCode;
        }

        WorkOptionCodeEnum(String code) {
            this.mCode = code;
        }

    }
    //add by Andrew.yin 2017/7/3 end.


    //add by Andrew.yin 2017/7/3 begin. [我的]页面选项码, 用于Event事件的区分
    public enum MeOptionCodeEnum {

        CHANGE_PASSWORD("CHANGE_PASSWORD"),        //密码修改
        CHANGE_USER_NAME("CHANGE_USER_NAME"),      //用户名修改
        CHANGE_USER("CHANGE_USER"),                //切换用户
        SEVER_SETTING("SEVER_SETTING"),            //服务器设置
        APP_UPDATE("APP_UPDATE"),                  //版本更新
        CHECK_ITEM_BINDING("CHECK_ITEM_BINDING"),  //检查项目管理
        APP_ABOUT("APP_ABOUT");                    //关于

        private String mCode;

        public String getCode() {
            return this.mCode;
        }

        MeOptionCodeEnum(String code) {
            this.mCode = code;
        }

    }
    //add by Andrew.yin 2017/7/3 end.


    //add by Andrew.yin 2017/7/3 begin. [安全台账]页面选项码, 用于Event事件的区分
    public enum LedgerOptionCodeEnum {

        COMMON_INFO("COMMON_INFO"),                //基本信息
        BUILDING_INFO("BUILDING_INFO"),            //建筑信息
        EMERGENCY("EMERGENCY"),                    //应急处置
        MAINTENANCE("MAINTENANCE"),                //维保登记
        PROPERTY("PROPERTY"),                      //物业登记
        SAFE_SETTING("SAFE_SETTING");              //安全设置

        private String mCode;

        public String getCode() {
            return this.mCode;
        }

        LedgerOptionCodeEnum(String code) {
            this.mCode = code;
        }

    }
    //add by Andrew.yin 2017/7/3 end.


    public enum RecordFunctionEnum {

        /**
         * 一企一档
         */
        LOACL_PATROL_TYPE("LOACL_PATROL_TYPE"),                    //检查点位
        LOACL_HIDDEN_TYPE("LOACL_HIDDEN_TYPE"),                    // 隐患记录
        WEB_NORMAL_INFO_TYPE("WEB_NORMAL_INFO_TYPE"),              // 基本信息
        WEB_PERSON_TYPE("WEB_PERSON_TYPE"),                        // 企业人员
        WEB_MAJOR_HAZARD_TYPE("WEB_MAJOR_HAZARD_TYPE"),            // 重大危险源
        WEB_SPECIAL_EQUIPMENT_TYPE("WEB_SPECIAL_EQUIPMENT_TYPE"),  // 特种设备
        WEB_MATERIALS_INFO_TYPE("WEB_MATERIALS_INFO_TYPE"),        // 物料信息
        WEB_TANKS_INFO_TYPE("WEB_TANKS_INFO_TYPE"),                // 储罐信息
        WEB_DUST_INFO_TYPE("WEB_DUST_INFO_TYPE"),                  // 粉尘信息
        WEB_CONFINED_SPACE_TYPE("WEB_CONFINED_SPACE_TYPE"),        // 受限空间
        LOCAL_ELECTRICAL_TYPE("LOCAL_ELECTRICAL_TYPE"),            // 配电箱信息
        LOCAL_AIR_TYPE("LOCAL_AIR_TYPE"),                          // 可燃气体
        LOCAL_HIGH_DANGER_TYPE("LOCAL_HIGH_DANGER_TYPE"),       // 高危工艺
        LOCAL_METALLURGY_TYPE("LOCAL_METALLURGY_TYPE"),          //冶金信息
        LOCAL_AMMONIA_TYPE("LOCAL_AMMONIA_TYPE"),          //液氨信息
        LOCAL_OCCUPATIONA_TYPE("LOCAL_OCCUPATIONA_TYPE"),        //职业病危害因素
        LOCAL_EMERGENCY_TYPE("LOCAL_EMERGENCY_TYPE"),           //应急物资：
        LOCAL_SPECISL_TASK_TYPE("LOCAL_SPECISL_TASK_TYPE"), //特种作业操作证人员
        LOCAL_COMPANY_TRAINING_TYPE("LOCAL_COMPANY_TRAINING_TYPE"), //企业安全培训信息
        LOCAL_EMERGENCY_PLAN_TYPE("LOCAL_EMERGENCY_PLAN_TYPE");   //应急预案
        private String type;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        RecordFunctionEnum(String type) {
            this.type = type;
        }

    }
}
